home *** CD-ROM | disk | FTP | other *** search
- function searchContents(name)
- {
- z = 0;
- while(z < _level0.contents.length)
- {
- if(String(_level0.contents[z].indexKey) == name)
- {
- trace(z);
- return z;
- }
- z++;
- }
- }
- function xmlDataInput(nodeNum)
- {
- defaultnode = xmlData.childNodes[0].childNodes[nodeNum];
- num = defaultnode.childNodes.length;
- if(num == undefined)
- {
- trace("undefined XML data error");
- }
- else
- {
- k = 0;
- while(k < num)
- {
- file = defaultnode.childNodes[k].childNodes[0].nodeValue;
- level = defaultnode.nodeName;
- title = defaultnode.childNodes[k].attributes.title;
- indexKey = defaultnode.childNodes[k].nodeName;
- contents.push({indexKey:indexKey,file:file,level:level,title:title});
- k++;
- }
- }
- }
- function createContents(success)
- {
- if(success)
- {
- level_count = xmlData.childNodes[0].childNodes.length;
- i = 0;
- while(i < level_count)
- {
- xmlDataInput(i);
- i++;
- }
- _level0.korPath = xmlData.childNodes[1].childNodes[0].nodeValue;
- _level0.engPath = xmlData.childNodes[2].childNodes[0].nodeValue;
- _level0.japPath = xmlData.childNodes[3].childNodes[0].nodeValue;
- _level0.simPath = xmlData.childNodes[4].childNodes[0].nodeValue;
- _level0.tradPath = xmlData.childNodes[5].childNodes[0].nodeValue;
- _level0.movPath = xmlData.childNodes[6].childNodes[0].nodeValue;
- _level0.downPath = xmlData.childNodes[7].childNodes[0].nodeValue;
- }
- }
- function loadContents(success)
- {
- createContents(success);
- loadCommandEX("language");
- }
- fscommand("fullscreen","true");
- fscommand("allowscale","false");
- fscommand("showmenu","false");
- var startMovie;
- var globalDepth = 1;
- var currentPath;
- MovieClip.prototype.dumpStop = function(targetFrame)
- {
- this.onEnterFrame = function()
- {
- if(this._currentframe != targetFrame)
- {
- this.gotoAndStop(targetFrame);
- }
- else
- {
- this.onEnterFrame = null;
- }
- };
- };
- MovieClip.prototype.targetPlay = function(targetFrame)
- {
- this.onEnterFrame = function()
- {
- if(this._currentframe > targetFrame)
- {
- this.prevFrame();
- }
- else if(this._currentframe < targetFrame)
- {
- this.nextFrame();
- }
- else
- {
- this.gotoAndStop(targetFrame);
- this.onEnterFrame = null;
- }
- };
- };
- MovieClip.prototype.move = function(tPos, speed)
- {
- this.createEmptyMovieClip(this._name + "1",10);
- this[this._name + "1"].onEnterFrame = function()
- {
- if(this._parent._y > tPos)
- {
- var distance = this._parent._y - tPos;
- this._parent._y -= Math.ceil(distance * speed);
- }
- else if(this._parent._y < tPos)
- {
- var distance = tPos - this._parent._y;
- this._parent._y += Math.ceil(distance * speed);
- }
- else
- {
- this.onEnterFrame = null;
- }
- };
- };
- MovieClip.prototype.BSloader = function(filename, level)
- {
- if(level != "mov")
- {
- loadMovieNum(filename,Number(level));
- }
- else
- {
- loadMovie(filename,eval(level));
- }
- _level0.loadswf.push(filename);
- _level0.loadlevel.push(level);
- _level0.totalcheck = [];
- _level0.fl = 0;
- _level0.ft = 0;
- _level0.onEnterFrame = function()
- {
- z = 0;
- if(!_level0.check_load)
- {
- i = 0;
- while(i < _level0.loadswf.length)
- {
- targetLevel = eval("_level" + String(_level0.loadlevel[i]));
- total = targetLevel.getBytesTotal();
- if(total > 0)
- {
- _level0.totalcheck[i] = total;
- z++;
- check_count++;
- if(check_count > 100)
- {
- _level0.onEnterFrame = null;
- }
- }
- i++;
- }
- if(z == _level0.loadswf.length)
- {
- i = 0;
- while(i < _level0.loadswf.length)
- {
- ft += _level0.totalcheck[i];
- i++;
- }
- _level0.check_load = true;
- }
- }
- else
- {
- i = 0;
- while(i < _level0.loadswf.length)
- {
- targetLevel = eval("_level" + String(_level0.loadlevel[i]));
- fl += targetLevel.getBytesLoaded();
- i++;
- }
- p = Math.round(fl / ft * 100);
- if(fl == ft)
- {
- i = 0;
- while(i < _level0.loadswf.length)
- {
- targetLevel = eval("_level" + String(_level0.loadlevel[i]));
- targetLevel.gotoAndPlay(targetLevel._currentframe + 1);
- i++;
- }
- _level0.loadswf = [];
- _level0.loadlevel = [];
- _level0.onEnterFrame = null;
- _level0.check_load = false;
- _level0.totalcheck = [];
- ft = 0;
- }
- else
- {
- fl = 0;
- }
- }
- };
- };
- MovieClip.prototype.loadCommandEX = function(name)
- {
- swfID = _level0.searchContents(name);
- i = 0;
- while(i < _level0.contents.length)
- {
- if(i == swfID)
- {
- BSloader(_level0.contents[i].file,_level0.contents[i].level);
- }
- i++;
- }
- };
- MovieClip.prototype.loadMov = function(name, targetMovie)
- {
- swfID = _level0.searchContents(name);
- i = 0;
- while(i < _level0.contents.length)
- {
- if(i == swfID)
- {
- BSloader(_level0.contents[i].file,targetMovie);
- }
- i++;
- }
- };
- MovieClip.prototype.contentsLevel = function(name)
- {
- num = _level0.searchContents(name);
- targetlevel = eval("_level" + _root.contents[num].level);
- return targetlevel;
- };
- MovieClip.prototype.download = function(filename)
- {
- getURL(_level0.downPath + filename,"_blank");
- };
- MovieClip.prototype.openfolder = function(name)
- {
- drive = this._url;
- trace(drive);
- drive = drive.substr(8,1);
- getURL(drive + ":" + name,"");
- };
- Stage.showMenu = false;
- contents = new Array();
- loadswf = new Array();
- loadlevel = new Array();
- xmlData = new XML();
- xmlData.ignoreWhite = true;
- xmlData.onLoad = loadContents;
- xmlData.load("contents.xml");
-